package com.lwc.mapper;

import com.lwc.bean.GodownEntry;
import com.lwc.bean.GodownEntryDetails;
import com.lwc.bean.GodownEntryQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface GodownEntryMapper {
    List<Map> query(GodownEntryQuery godownEntryQuery);

    /**
     * 通过入库单号id入库详情
     * @param id 单号id
     * @return
     */
    List<GodownEntryDetails> getqueryById(int id);

    /*
    审核通过
     */
    @Update("update  godown_entry  set  godown_status=2  where id=#{id} and isdel=0")
    int getupdateflaseById(int id);

    /**
     * 审核不通过
     * @param
     * @return
     */
    @Update("update  godown_entry  set  godown_status=1  where id=#{id} and isdel=0")
    int getupdatetrue(int id);

    @Update("update  godown_entry  set  reason=#{reason}  where id=#{id} and isdel=0")
    void updatereason(@Param("reason") String reason, @Param("id")int id);
}
